package com.neusoft.hifly.push.email.pojo;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import org.apache.commons.lang3.StringUtils;

/**
 * Title: 核心类库
 * <p>
 * Description: 收邮件实体
 * <p>
 * Copyright: 2019
 * <p>
 * Company: 东软汉枫
 *
 * @author lh_neu
 * @version 1.0.0
 */
public class MailReceiverInfo implements Serializable, Cloneable {
	private static final long serialVersionUID = -895195953542356206L;
	// 接收邮件的服务器的IP
	private String host;
	// 接收邮件的服务器的端口
	private int port = 110;
	// 协议类型    ：pop3
	private String store;
	// 收件箱文件夹    ："INBOX"
	private String folder;
	// 登陆邮件发送服务器的密码
	private String userName;
	// 登陆邮件发送服务器的用户名
	private String password;
	// 是否需要身份验证
	private boolean validate = false;
	// 是否开启Debug调试
	private boolean isDebug = false;

	// 邮件发送者的地址   (多个地址以(英文)分号分割)
	private String fromAddress;
	// 邮件抄送者的地址    (多个地址以(英文)分号分割)
	private String replyToAddress;
	// 邮件接收者的地址   (多个地址以(英文)分号分割)
	private String toAddress;
	// 邮件接收者组   (多个地址以(英文)分号分割)
	private String toGroupAddress;
	// 发送日期
	private Date sentDate;
	// 接收日期
	private Date receivedDate;
	// 邮件主题
	private String subject;
	// 邮件的文本内容
	private String content;
	// 邮件附件
	private List<MailFileObj> attachs;

	/**
	 * 克隆对象
	 *
	 * @return 对象
	 */
	@Override
	public MailReceiverInfo clone() {
		MailReceiverInfo obj = null;
		try {
			obj = (MailReceiverInfo) super.clone();
		} catch (final CloneNotSupportedException e) {
			e.printStackTrace();
		}
		return obj;
	}

	public String getFolder() {
		if (StringUtils.isEmpty(folder)) {
			folder = "INBOX";
		}
		return folder;
	}

	public String getHost() {
		return host;
	}

	public void setHost(final String host) {
		this.host = host;
	}

	public int getPort() {
		return port;
	}

	public void setPort(final int port) {
		this.port = port;
	}

	public String getStore() {
		return store;
	}

	public void setStore(final String store) {
		this.store = store;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(final String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(final String password) {
		this.password = password;
	}

	public boolean isValidate() {
		return validate;
	}

	public void setValidate(final boolean validate) {
		this.validate = validate;
	}

	public boolean isDebug() {
		return isDebug;
	}

	public void setDebug(final boolean isDebug) {
		this.isDebug = isDebug;
	}

	public String getFromAddress() {
		return fromAddress;
	}

	public void setFromAddress(final String fromAddress) {
		this.fromAddress = fromAddress;
	}

	public String getReplyToAddress() {
		return replyToAddress;
	}

	public void setReplyToAddress(final String replyToAddress) {
		this.replyToAddress = replyToAddress;
	}

	public String getToAddress() {
		return toAddress;
	}

	public void setToAddress(final String toAddress) {
		this.toAddress = toAddress;
	}

	public String getToGroupAddress() {
		return toGroupAddress;
	}

	public void setToGroupAddress(final String toGroupAddress) {
		this.toGroupAddress = toGroupAddress;
	}

	public Date getSentDate() {
		return sentDate;
	}

	public void setSentDate(final Date sentDate) {
		this.sentDate = sentDate;
	}

	public Date getReceivedDate() {
		return receivedDate;
	}

	public void setReceivedDate(final Date receivedDate) {
		this.receivedDate = receivedDate;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(final String subject) {
		this.subject = subject;
	}

	public String getContent() {
		return content;
	}

	public void setContent(final String content) {
		this.content = content;
	}

	public List<MailFileObj> getAttachs() {
		return attachs;
	}

	public void setAttachs(final List<MailFileObj> attachs) {
		this.attachs = attachs;
	}

	public void setFolder(final String folder) {
		this.folder = folder;
	}

}
